<!DOCTYPE html>
<html>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width,initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
</head>

<body>
    <div id='app'>
        <!-- v-on作用:绑定事件 -->
        <!-- 语法  @事件名.修饰符="methods中的方法" -->

        <!-- <button v-on:click="num++">按钮</button> -->
        <!-- <button v-on:click="fn()">按钮</button> -->
        <!-- <button v-on:click="fn('abc')">按钮</button> -->
        <!-- <button v-for="(v,i) in arr" :key="i" v-on:click="fn1(i)">按钮</button> -->
        <!-- <button v-on:click.once="fn('abc')">按钮</button> -->
        <!-- 简写 用@取代v-on: -->
        <!-- <button @click.once="fn('abc')">按钮</button> -->
        <!-- 绑定多个事件 -->
        <!-- <button @click="fn(1)" @mouseup="fn1(1)">按钮</button> -->
        <!-- 2.4+ -->
        <!-- <button v-on="{ mousedown: doThis, mouseup: doThat }"></button> -->
        <!-- <button v-on="{ mousedown: fn(1), mouseup: fn1(2)}">按钮</button> -->
        <!-- $event需要调用方式进行传参 固定写法 -->
        <button @click="fn2($event,'abc')">按钮</button>



    </div>
    <script src='./vue.js'></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                arr: [1, 2, 3],
                num: 1
            },
            methods: {
                fn2(e, argv) {
                    console.log(argv);

                    console.log(e);

                },
                fn1(index) {
                    console.log(index);
                },
                fn(argv) {
                    console.log(argv);

                    // console.log('fn----');

                }
            }
        });
    </script>
</body>

<!-- </html> -->